package com.inspire.ijc.agent.storage.entity;

/**
 * @author ：inspire
 * @date ：Created in 2023/4/13 13:51
 * @description：
 * @modified By：inspire
 * @version:
 */
public class CallMethod implements Comparable<CallMethod>{
    private String className;
    private String methodName;
    private long startTime;
    private long costTime;
    private int order;//函数调用顺序（第几次push）
    private int depth;
    private int id;
    //用于计算函数调用次数（基于循环/递归考虑）

    public CallMethod(String className, String methodName, long startTime,Integer order,int id) {
        this.className = className;
        this.methodName = methodName;
        this.startTime=startTime;
        this.order=order;
        this.id=id;
    }

    public CallMethod(String className, String methodName, long startTime,Integer order,int depth,int id) {
        this.className = className;
        this.methodName = methodName;
        this.startTime=startTime;
        this.order=order;
        this.depth=depth;
        this.id=id;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public long getStartTime() {
        return startTime;
    }

    public void setStartTime(long startTime) {
        this.startTime = startTime;
    }

    public long getCostTime() {
        return costTime;
    }

    public void setCostTime(long costTime) {
        this.costTime = costTime;
    }

    public int getOrder() {
        return order;
    }

    public void setOrder(int order) {
        this.order = order;
    }

    public int getDepth() {
        return depth;
    }

    public void setDepth(int depth) {
        this.depth = depth;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Override
    public int compareTo(CallMethod o) {
        return this.getOrder()-o.getOrder();
    }

    @Override
    public String toString() {
        return "CallMethod{" +
                "className='" + className + '\'' +
                ", methodName='" + methodName + '\'' +
                ", startTime=" + startTime +
                ", costTime=" + costTime +
                ", order=" + order +
                ", depth=" + depth +
                '}';
    }
}
